package com.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.entity.WorklogsEntity;
@Repository
public class WorklogsDaoImpl extends GenericDaoImpl<WorklogsEntity> implements
		WorklogsDao {


	public WorklogsEntity getWorklogsById(int id) {
		return getById(WorklogsEntity.class, id);
	}

	public List<WorklogsEntity> getAllWorklogs() {
		return getAll(WorklogsEntity.class);
	}
	
	public WorklogsEntity getWorklogsByUniqueId(String id) {
		String hql = "From WorklogsEntity where id =:id";
		Query query = sessionFactory.getCurrentSession().createQuery(hql);
		query.setParameter("id",id);
		return (WorklogsEntity) query.uniqueResult();
	}

}
